package com.hopu.community_task.interceptor;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;

public class LoginInterceptor  extends MethodFilterInterceptor{

	

	@Override
	protected String doIntercept(ActionInvocation invoc) throws Exception {
		Object user = ActionContext.getContext().getSession().get("userinfo");
		if(user==null) {
			return "login";
		}
		invoc.invoke();
		
		return null;
	}

}
